<?php

/**
 * Spiral Framework.
 *
 * @license   MIT
 * @author    Anton Titov (Wolfy-J)
 */

declare(strict_types=1);

use Spiral\Database\Driver;

return [
    'default'   => 'default',
    'databases' => [
        'default' => [
            'driver' => env('DB_DRIVER','mysql'),
            'prefix' => env('DB_PREFIX', ''),
        ],
    ],
    'drivers'   => [
        'sqlite' => [
            'driver'     => Driver\SQLite\SQLiteDriver::class,
            'connection' => 'sqlite:' . env('DB_DATABASE', 'runtime/runtime.db'),
            'profiling'  => true,
        ],
        'mysql' => [
            'driver' => Driver\MySQL\MySQLDriver::class,
            'connection' => implode('', [
                'mysql:host=',
                env('DB_HOST', 'localhost'),
                ';port=',
                env('DB_PORT', 3306),
                ';dbname=',
                env('DB_DATABASE', 'spiral'),
                ';charset=',
                env('DB_CHARSET', 'utf8mb4'),
            ]),
            'username' => env('DB_USERNAME', 'dev'),
            'password' => env('DB_PASSWORD', 'password'),
        ],
    ]
];
